home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / layout / nsHTMLParts.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  10KB  |  263 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37. #ifndef nsHTMLParts_h___
  38. #define nsHTMLParts_h___
  39.  
  40. #include "nscore.h"
  41. #include "nsISupports.h"
  42. #include "nsReflowType.h"
  43. class nsHTMLReflowCommand;
  44. class nsIAtom;
  45. class nsINodeInfo;
  46. class nsIContent;
  47. class nsIContentIterator;
  48. class nsIDocument;
  49. class nsIFrame;
  50. class nsIHTMLContentSink;
  51. class nsIFragmentContentSink;
  52. class nsPresContext;
  53. class nsITextContent;
  54. class nsIURI;
  55. class nsString;
  56. class nsIPresShell;
  57. class nsIChannel;
  58.  
  59. /**
  60.  * Additional frame-state bits used by nsBlockFrame
  61.  * See the meanings at http://www.mozilla.org/newlayout/doc/block-and-line.html
  62.  */
  63. #define NS_BLOCK_SHRINK_WRAP                0x00100000
  64. #define NS_BLOCK_NO_AUTO_MARGINS            0x00200000
  65. #define NS_BLOCK_MARGIN_ROOT                0x00400000
  66. #define NS_BLOCK_SPACE_MGR                  0x00800000
  67. #define NS_BLOCK_HAS_FIRST_LETTER_STYLE     0x20000000
  68. #define NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET   0x40000000
  69. // These are the bits that get inherited from a block frame to its
  70. // next-in-flows and are not private to blocks
  71. #define NS_BLOCK_FLAGS_MASK                 0xF0F00000
  72.  
  73. // Factory method for creating a content iterator for generated
  74. // content
  75. nsresult
  76. NS_NewFrameContentIterator(nsPresContext*      aPresContext,
  77.                            nsIFrame*            aFrame,
  78.                            nsIContentIterator** aIterator);
  79.  
  80. // Factory methods for creating html layout objects
  81.  
  82. // These are variations on AreaFrame with slightly different layout
  83. // policies.
  84.  
  85. // Create a frame that supports "display: block" layout behavior
  86. nsresult
  87. NS_NewBlockFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
  88.                  PRUint32 aFlags = 0);
  89.  
  90. // Special Generated Content Frame
  91. nsresult
  92. NS_NewAttributeContent(PRInt32 aNameSpaceID, nsIAtom* aAttrName,
  93.                        nsIContent** aResult);
  94.  
  95. // Create a basic area frame but the GetFrameForPoint is overridden to always
  96. // return the option frame 
  97. // By default, area frames will extend
  98. // their height to cover any children that "stick out".
  99. nsresult
  100. NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
  101.                        PRUint32 aFlags);
  102.  
  103. // Create a basic area frame.
  104. nsresult
  105. NS_NewAreaFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
  106.                 PRUint32 aFlags);
  107.  
  108. // These AreaFrame's shrink wrap around their contents
  109. inline nsresult
  110. NS_NewTableCellInnerFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
  111.   return NS_NewBlockFrame(aPresShell, aNewFrame,
  112.                           NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
  113. }
  114.  
  115. // This type of AreaFrame is the document root, a margin root, and the
  116. // initial containing block for absolutely positioned elements
  117. inline nsresult
  118. NS_NewDocumentElementFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
  119.   return NS_NewAreaFrame(aPresShell, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
  120. }
  121.  
  122. // This type of AreaFrame is a margin root, but does not shrink wrap
  123. inline nsresult
  124. NS_NewAbsoluteItemWrapperFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
  125.   return NS_NewAreaFrame(aPresShell, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
  126. }
  127.  
  128. // This type of AreaFrame shrink wraps
  129. inline nsresult
  130. NS_NewFloatingItemWrapperFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
  131.   return NS_NewAreaFrame(aPresShell, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_SHRINK_WRAP|NS_BLOCK_MARGIN_ROOT);
  132. }
  133.  
  134. // This type of AreaFrame doesn't use its own space manager and
  135. // doesn't shrink wrap.
  136. inline nsresult
  137. NS_NewRelativeItemWrapperFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
  138.   return NS_NewAreaFrame(aPresShell, aNewFrame, 0);
  139. }
  140.  
  141. nsresult
  142. NS_NewBRFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  143.  
  144. nsresult
  145. NS_NewCommentFrame(nsIPresShell* aPresShell, nsIFrame** aFrameResult);
  146.  
  147. // <frame> and <iframe> 
  148. nsresult
  149. NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  150. // <frameset>
  151. nsresult
  152. NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  153.  
  154. nsresult
  155. NS_NewViewportFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  156. nsresult
  157. NS_NewCanvasFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  158. nsresult
  159. NS_NewImageFrame(nsIPresShell* aPresShell, nsIFrame** aFrameResult);
  160. nsresult
  161. NS_NewInlineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  162. nsresult
  163. NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  164. nsresult
  165. NS_NewObjectFrame(nsIPresShell* aPresShell, nsIFrame** aFrameResult);
  166. nsresult
  167. NS_NewSpacerFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  168. nsresult
  169. NS_NewTextFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  170. nsresult
  171. NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  172. nsresult
  173. NS_NewEmptyFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  174. inline nsresult
  175. NS_NewWBRFrame(nsIPresShell* aPresShell, nsIFrame** aResult) {
  176.   return NS_NewEmptyFrame(aPresShell, aResult);
  177. }
  178.  
  179. nsresult
  180. NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aStateFlags );
  181.  
  182. nsresult
  183. NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  184. nsresult
  185. NS_NewPageFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  186. nsresult
  187. NS_NewPageContentFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  188. nsresult
  189. NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  190. nsresult
  191. NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  192. nsresult
  193. NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  194.  
  195. // forms
  196. nsresult
  197. NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  198. nsresult
  199. NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  200. nsresult
  201. NS_NewImageControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  202. nsresult
  203. NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  204. nsresult
  205. NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  206. nsresult
  207. NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  208. nsresult
  209. NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsIFrame** aResult, PRUint32 aFlags);
  210. nsresult
  211. NS_NewFileControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  212. nsresult
  213. NS_NewLegendFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  214. nsresult
  215. NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  216. nsresult
  217. NS_NewTextControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  218. nsresult
  219. NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  220. nsresult
  221. NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  222. nsresult
  223. NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  224. nsresult
  225. NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  226. nsresult
  227. NS_NewListControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  228. nsresult
  229. NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult, PRUint32 aFlags);
  230. nsresult
  231. NS_NewIsIndexFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  232.  
  233. // Table frame factories
  234. nsresult
  235. NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  236. nsresult
  237. NS_NewTableFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  238. nsresult
  239. NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
  240.  
  241. nsresult
  242. NS_NewTableColFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  243. nsresult
  244. NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  245. nsresult
  246. NS_NewTableRowFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  247. nsresult
  248. NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
  249. nsresult
  250. NS_NewTableCellFrame(nsIPresShell* aPresShell, PRBool aIsBorderCollapse, nsIFrame** aResult);
  251.  
  252. nsresult
  253. NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
  254.                       nsIDocument* aDoc, nsIURI* aURL,
  255.                       nsISupports* aContainer, // e.g. docshell
  256.                       nsIChannel* aChannel);
  257. nsresult
  258. NS_NewHTMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult);
  259. nsresult
  260. NS_NewHTMLFragmentContentSink2(nsIFragmentContentSink** aInstancePtrResult);
  261.  
  262. #endif /* nsHTMLParts_h___ */
  263.